/* 
 * File:   CoordinatesInverter.h
 * Author: Guilherme Monteiro
 *
 */

#ifndef COORDINATESINVERTER_H
#define	COORDINATESINVERTER_H

#include <cv.h>
#include <highgui.h>
#include <cxcore.h>

#include "../headers/MetaInfo.h"
#include "../headers/NullImageException.h"

using namespace std;

/**
 * Class that represents a coordinates inverter.
 * It is used to invert the coordinates when an image
 * is rotated in ninety degrees.
 * 
 * @param vec: vector with the original coordinates: vec[0] == left upper and
 * vec[1] == right bottom
 */
class CoordinatesInverter {
public:
    CoordinatesInverter(vector<CvPoint> vec, IplImage* img) throw (NullImageException);
    CoordinatesInverter(const CoordinatesInverter& orig);
    virtual ~CoordinatesInverter();
    vector<CvPoint> invertPoints();
private:
    vector<CvPoint> points;
    IplImage* img;
    
    void setImg(IplImage* originalImg) throw (NullImageException);
};

#endif	/* COORDINATESINVERTER_H */

